<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">
	<span class="color_red">*</span>项目组主要参与者
</div>
<table  id="zh_persons" border="0" cellspacing="0" cellpadding="0" class="table01" >
		<thead>
			<tr>
                <th align="center" width="30px">选择</th>
                <th align="center" width="25px">序号</th>
				<th align="center" width="80px">姓名</th>
				<th align="center" width="100px">身份证号码/其他号码</th>
				<th align="center" width="30px">性别</th>
				<th align="center" width="65px">职称</th>
				<th align="center" width="60px">学位</th>
				<th align="center" width="60px">从事专业</th>
				<th align="center" width="100px">单位名称</th>
				<th align="center" width="100px">电话</th>
				<th align="center" width="100px">电子邮箱</th>
				<th align="center" width="80px">项目分工</th>
				<th align="center" width="60px">每年工作时间（月）</th>
			</tr>
		</thead>
		<tbody id="tab">
			<tr style="display: none">
				<td nowrap="true" align="center"  width="50px" >
					<input type="radio" name="sel_zh_persons" onclick="setSubmitPsn()" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|ethnicity_value" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|ethnicity_name" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|region_value" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|region_name" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|birthday" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|card_type_value" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|card_type_name" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|academician_value" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|academician_name" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|org_code" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|contact|tel_work" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|contact|fax" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|post_code" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|degree_value" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|degree_college" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|degree_year" /> 
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|position" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|major" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|specialty" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|address" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|prof_title_value" />
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|post_doctor_value"/>
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|post_doctor_name"/>
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|birth_date"/>
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|educate_value"/>
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|educate_name"/>
					<input type="hidden" name="zh_persons|zh_person[0]|basic_info|gender_value"/>
					<input type="hidden" name="zh_persons|zh_person[0]|iscomember" value="0"/>

					<input type="hidden" name="zh_persons|zh_person[0]|researches" label="xml"/>
					
				</td>
				<td>
					<span name="zh_persons|zh_person[0]@seq_no">[index]</span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|basic_info|zh_name"></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|basic_info|card_code"></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|basic_info|gender_value_name"></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|basic_info|prof_title_name"></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|basic_info|degree_name"></span>
				</td>

				<td>
					<span name="zh_persons|zh_person[0]|basic_info|major_work"></span>
				</td>
				<td>
					<span  name="zh_persons|zh_person[0]|basic_info|org_name" ></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|contact|mobile" ></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|contact|email" ></span>
				</td>
				<td>
					<span name="zh_persons|zh_person[0]|basic_info|work" ></span>
				</td>
				<td>
					<input type="text" class="input_text" label="项目参与人信息中的每年工作月数" disabled style="text-align:right" name="zh_persons|zh_person[0]|basic_info|working_time" size="14" />  
				</td>
			</tr>
		<c:set value="0" var="index" scope="page" />
			 <x:forEach select="$xmlData/data/zh_persons/zh_person" var="zh_person">
				
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr>
					<td nowrap=true align="center"  width="50px" >
						<input type="radio" name="sel_zh_persons" onclick="setSubmitPsn()" /> 
						<c:if test="${index==0}">
							<input type="hidden" id="submit_psn" name="zh_persons/zh_person[${flag}${index}]@submit_psn" value="1" />
							<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/psn_code" value="<x:out select="$zh_person/basic_info/psn_code" />"/>
						</c:if>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/en_name" value="<x:out select="$zh_person/basic_info/en_name" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/ethnicity_value" value="<x:out select="$zh_person/basic_info/ethnicity_value" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/ethnicity_name" value="<x:out select="$zh_person/basic_info/ethnicity_name" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/region_value" value="<x:out select="$zh_person/basic_info/region_value" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/region_name" value="<x:out select="$zh_person/basic_info/region_name" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/birthday" value="<x:out select="$zh_person/basic_info/birthday" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/card_type_value" value="<x:out select="$zh_person/basic_info/card_type_value" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/card_type_name" value="<x:out select="$zh_person/basic_info/card_type_name" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/academician_value" value="<x:out select="$zh_person/basic_info/academician_value" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/academician_name" value="<x:out select="$zh_person/basic_info/academician_name" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/org_code" value="<x:out select="$zh_person/basic_info/org_code" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/contact/tel_work" value="<x:out select="$zh_person/contact/tel_work" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/contact/fax" value="<x:out select="$zh_person/contact/fax" />" />
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/degree_value" value="<x:out select="$zh_person/basic_info/degree_value" />" />
						
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/post_code" value="<x:out select="$zh_person/basic_info/post_code" />" />
						
						
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/degree_college" value="<x:out select="$zh_person/basic_info/degree_college" />" /> 
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/degree_year" value="<x:out select="$zh_person/basic_info/degree_year" />" /> 
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/prof_title_value" value="<x:out select="$zh_person/basic_info/prof_title_value" />" /> 
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/address" value="<x:out select="$zh_person/basic_info/address" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/position" value="<x:out select="$zh_person/basic_info/position" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/major" value="<x:out select="$zh_person/basic_info/major" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/specialty" value="<x:out select="$zh_person/basic_info/specialty" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/post_doctor_value" value="<x:out select="$zh_person/basic_info/post_doctor_value" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/post_doctor_name" value="<x:out select="$zh_person/basic_info/post_doctor_name" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/birth_date" value="<x:out select="$zh_person/basic_info/birth_date" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/educate_value" value="<x:out select="$zh_person/basic_info/educate_value" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/educate_name" value="<x:out select="$zh_person/basic_info/educate_name" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/gender_value" value="<x:out select="$zh_person/basic_info/gender_value" />"/>
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/iscomember" value="0"/>
						
						<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/researches" label="xml"/>
					</td>
					<td>
					<span name="zh_persons/zh_person[${flag}${index}]@seq_no">${index+1}</span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/zh_name"><x:out select="$zh_person/basic_info/zh_name" /></span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/card_code"><x:out select="$zh_person/basic_info/card_code" /></span>
					</td>
					<td>
					    <span name="zh_persons/zh_person[${flag}${index}]/basic_info/gender_value_name">  
					       <c:set var="gender_value_name"><x:out select="$zh_person/basic_info/gender_value_name" /></c:set>
					       <c:set var="gender_value"><x:out select="$zh_person/basic_info/gender_value" /></c:set>
					       <c:choose>
					          <c:when test="${not empty gender_value_name}">
					               <x:out select="$zh_person/basic_info/gender_value_name" />
					          </c:when>
					          <c:when test="${empty gender_value_name && gender_value == 'M'}">
						                             男
					          </c:when>
					          <c:when test="${empty gender_value_name && gender_value == 'F'}">
						                             女 
					          </c:when>
					       </c:choose>
					    </span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/prof_title_name"><x:out select="$zh_person/basic_info/prof_title_name" /></span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/degree_name"><x:out select="$zh_person/basic_info/degree_name" /></span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/major_work"><x:out select="$zh_person/basic_info/major_work" /></span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/org_name"><x:out select="$zh_person/basic_info/org_name" /></span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/contact/mobile"><x:out select="$zh_person/contact/mobile" /></span>
					</td>
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/contact/email"><x:out select="$zh_person/contact/email" /></span>
					</td>
					
					<td>
						<span name="zh_persons/zh_person[${flag}${index}]/basic_info/work"><c:choose><c:when test="${index==0}">项目负责人</c:when><c:otherwise><x:out select="$zh_person/basic_info/work" /></c:otherwise></c:choose></span>
					</td>
			
				    <td>
					    <c:choose>
							<c:when test="${index==0}">
								<input type="text" class="required input_text  min:1 max:12" style="text-align:right" label="项目负责人信息中的每年工作月数" name="zh_persons/zh_person[${flag}${index}]/basic_info/working_time" value="<x:out select="$zh_person/basic_info/working_time" />" size="14" onfocus="InitInput.setInt(this, 2)"/>
							</c:when>
							<c:otherwise>
								<input type="text" class="required input_text" disabled label="项目参与信息中的每年工作月数" style="text-align:right" name="zh_persons/zh_person[${flag}${index}]/basic_info/working_time" value="<x:out select="$zh_person/basic_info/working_time" />" size="14"/>
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
			</x:forEach>
			</tbody>
	</table>
<br>

	<table border="0" cellpadding="0" cellspacing="1">
		<tr>
			<td>
				<c:set var="prjCode"><x:out select="$xmlData/data/proposal/prj_code" /></c:set>
				<c:if test="${empty prjCode}" ><c:set var="prjCode" value="" ></c:set></c:if>
				<input class="button_02" type="button" value="添加" onclick="if(checkTabLimit('zh_persons',99,'项目参与人员最多只能填写99条')){addNewRow('zh_persons','${ctx}/proposal/edit/dialog/psnInfoEdit_zrkx?parentTab=zh_persons&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','添加项目参与人');}try{top.resizeFrame();}catch(e){};">
				&nbsp;<input class="button_02"  id="zh_psnPrev" type="button" value="上移" onclick="movePrev('zh_persons');setSubmitPsn()">
				&nbsp;<input class="button_02"  id="zh_psnNext" type="button" value="下移" onclick="moveNext('zh_persons');setSubmitPsn()">
				&nbsp;<input class="button_02"  id="zh_psnEdit" type="button" value="编辑" onclick="if(checkSubmitPsn('zh_persons'))editRow('zh_persons','${ctx}/proposal/edit/dialog/psnInfoEdit_zrkx?parentTab=zh_persons&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','编辑项目参与人信息')">
				&nbsp;<input class="button_02"  id="zh_psnDel" type="button" value="删除" onclick="deleteSelectedRow('zh_persons','中方人员',1,'申请人不能被删除');"></td>
		</tr>
		</tbody>
		<tfoot>
		</tfoot>
	</table>
<br/>
<div class="t_bar">
	<span class="color_red">*</span>人员情况
</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1">

	
	<tr class="li_1">
		<td align="left">项目人员总数：</td>
		<td>
			<input type="text" name="zh_persons/psncnt_total" id="psncnt_total" 
			class="valueCompare:psncnt_total_gzd:psncnt_total required " label="项目人员总数" onfocus="InitInput.setNumber(this,7,0,0)" 
		    onchange="syntotal('psncnt_total','psncnt_total_same')"
			style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_total" />" />
			
			<input type="hidden" name="zh_persons/psncnt_total_same" id="psncnt_total_same" 
			class="valueCompare:psncnt_total_pps:psncnt_total_same " label="项目人员总数" onfocus="InitInput.setNumber(this,7,0,0)" 
			style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_total_same" />" />
			
			
			<input type="hidden" id="psncnt_total_tmp"  
			name="zh_persons/psncnt_total_tmp" onfocus="InitInput.setNumber(this,7,0,0)" 
			onchange="InitInput.setNumber(this,7,0,0)" label="高级、中级与低级职称、博士生、博士后、硕士生之和" 
			value="<x:out select="$xmlData/data/zh_persons/psncnt_total_tmp" />"  
            />
			
			<input type="hidden" name="zh_persons/psncnt_total_gzd" id="psncnt_total_gzd"  
			label="高级、中级与低级职称之和" onfocus="InitInput.setNumber(this,7,0,0)" 
			style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_total_gzd" />" />
			
			<input type="hidden" name="zh_persons/psncnt_total_pps" id="psncnt_total_pps" 
			 label="博士生、博士后与硕士生之和" onfocus="InitInput.setNumber(this,7,0,0)" 
			style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_total_pps" />" />
			
			
		</td>
		<td align="left" nowrap>其中  高级：</td>
		<td>
			<input type="text" id="psncnt_high" name="zh_persons/psncnt_high" class=" required"  label="项目人员高级职称人数" onfocus="InitInput.setNumber(this,7,0,0)"  style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_high" />" onchange="countNum('psncnt_','low,mid,high','total_gzd');countNum('psncnt_','low,mid,high','total_tmp');"/>
		</td>
			<td align="left"nowrap>中级：</td>
		<td>
			<input type="text" id="psncnt_mid" name="zh_persons/psncnt_mid" class=" required"   label="项目人员中级职称人数" onfocus="InitInput.setNumber(this,7,0,0)"  style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_mid" />" onchange="countNum('psncnt_','low,mid,high','total_gzd');countNum('psncnt_','low,mid,high,postdoctor,doctoral,master','total_tmp');" />
		</td>
		<td align="left"nowrap>初级：</td>
		<td>
			<input type="text" id="psncnt_low" name="zh_persons/psncnt_low" class=" required" label="项目人员初级职称人数" onfocus="InitInput.setNumber(this,7,0,0)"  style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_low" />" onchange="countNum('psncnt_','low,mid,high','total_gzd');countNum('psncnt_','low,mid,high,postdoctor,doctoral,master','total_tmp');"/>
		</td>
	
	</tr>
	<tr>
		<td align="left"nowrap>博士后：</td>
		<td>
			<input type="text" id="psncnt_postdoctor" name="zh_persons/psncnt_postdoctor" class=" required" label="项目人员博士后人数" onfocus="InitInput.setNumber(this,7,0,0)"  style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_postdoctor" />" onchange="countNum('psncnt_','postdoctor,doctoral,master','total_pps');countNum('psncnt_','low,mid,high,postdoctor,doctoral,master','total_tmp');"/>
		</td>
		<td align="left"nowrap>博士生：</td>
		<td>
			<input type="text" id="psncnt_doctoral" name="zh_persons/psncnt_doctoral" class=" required" label="项目人员博士生人数" onfocus="InitInput.setNumber(this,7,0,0)"  style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_doctoral" />" onchange="countNum('psncnt_','postdoctor,doctoral,master','total_pps');countNum('psncnt_','low,mid,high,postdoctor,doctoral,master','total_tmp');"/>
		</td>
		<td align="left"nowrap>硕士生：</td>
		<td>
			<input type="text" id="psncnt_master" name="zh_persons/psncnt_master" class=" required" label="项目人员硕士生人数" onfocus="InitInput.setNumber(this,7,0,0)"  style="text-align:right; width:100px;" value="<x:out select="$xmlData/data/zh_persons/psncnt_master" />" onchange="countNum('psncnt_','postdoctor,doctoral,master','total_pps');countNum('psncnt_','low,mid,high,postdoctor,doctoral,master','total_tmp');"/>
		</td>
	<tr>
</table>
<script type="text/javascript">
$(function(){
	
	//将申请书xml中的研究领域xml字符串设置到每个人的对应隐藏域
	//setPsnResearch("zh_persons", "xmlStr", "zh_person");
});
//比较2个数大小 待提取至public.js 中  原逻辑错误
function irisValThan(str1,str2,msg)
{		
	var minvalue = $("#"+str1).val();
	var maxvalue = $("#"+str2).val();
	if(minvalue=="")minvalue=0;
	if(maxvalue=="")maxvalue=0;
	if(parseFloat(maxvalue)<parseFloat(minvalue))
	{
		if(msg=="")
		{
			msg = strTitle+$("#"+str2).attr("label")+"不能小于"+$("#"+str1).attr("label");
		} 
		irisValaddMsg(msg);
		return false;
	}
	return true;
}
function checkSubmitPsn(tableId){
	var tr=$("#"+tableId+" :radio:checked").parents("tr");
	if(tr.length!=0 && tr.get(0).rowIndex==2){
		scmWarn('如果您需要修改申请人信息， 请保存申请书后点击菜单"管理">"个人信息维护"完成修改');
		return false;
	}
	return true;
		
}

function syntotal(id1,id2){
	$("#"+id2).val($("#"+id1).val());
}
</script>